package com.april.pattern.behavioral.observer;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

/**
 * @author April
 * @version V1.0.0
 * @date 2019/07/09 11:31
 * @description 观察者
 */
public class Teacher implements PropertyChangeListener {
    private String teacherName;

    private Course course;

    public Teacher(String teacherName) {
        super();
        this.teacherName = teacherName;
    }

    @Override
    public void propertyChange(PropertyChangeEvent evt) {
        Question question = (Question) evt.getNewValue();
        System.out.println(this.teacherName + "老师接收到了问题   问题名:" + question.getUserName() + "   问题内容："
                + question.getQuestionContent());
    }
}
